/*
 * @Author: liuxinyea
 * @Date: 2024-08-12 22:36:41
 * @LastEditors: liuxinyea
 * @LastEditTime: 2024-08-19 00:10:27
 * @Description: 描述
 */
import { _decorator, CCInteger, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('PeaBullet')
export class PeaBullet extends Component {
    @property(CCInteger)
    speed: number = 10;
    @property(CCInteger)
    public damage: number = 10;

    protected start(): void {
        
    }
    update(deltaTime: number) {
        this.node.setPosition(this.node.position.x + this.speed, this.node.position.y );
        // 超出屏幕后释放
        if(this.node.position.x > 1000){
            this.node.destroy();
        }
    }
}

